// Pour configurer le timer il suffit de changer 
//les 4 variables de dessous
var sec=0, cteSec=0;
var min=0, cteMin=0;
var t;
vartimer_is_on=0;

function timedCountMoins()
{
if(sec>0){
sec=sec-1;
}else{
sec=cteSec-1;
min=min-1;
}

if(min == 0 && sec==0){
 t=setTimeout("timedCountPlus()",1000);
}else{
 t=setTimeout("timedCountMoins()",1000);
}
document.getElementById('txt').value=min +" : "+sec;

}

function timedCountPlus()
{
document.getElementById('txt').style.backgroundColor="#FF4500";
if(sec<cteSec-1){
sec=sec+1;
}else{
sec=0;
min=min+1;
}
t=setTimeout("timedCountPlus()",1000);
document.getElementById('txt').value=min +" : "+sec;
}

function doTimer(s, cs, m, cm)
{
sec=s, cteSec=cs, min=m-1, cteMin=cm-1;
document.getElementById('txt').style.backgroundColor="#FFFFFF";

//if (!timer_is_on)
 // {
timer_is_on=1;
timedCountMoins();
document.getElementById('btnStart').disabled = true;
document.getElementById('btnStop').disabled = false;
 // }
}

 function stopCount()
{
clearTimeout(t);
timer_is_on=0;
sec=cteSec;
min=cteMin;
document.getElementById('btnStop').disabled = true;
document.getElementById('btnStart').disabled = false;
}